import request from '@/utils/request'

// 获取视频列表
export function getVideoList (data) {
  return request({
    url: `/video/video`,
    method: 'get',
    params: data,
  })
}

// 新增视频
export function addVideo (data) {
  return request({
    url: `/video/video`,
    method: 'post',
    data: data,
  })
}

// 获取视频详情
export function getVideoInfo (id) {
  return request({
    url: `/video/video/${id}`,
    method: 'get',
  })
}

// 修改视频
export function updateVideoInfo (id, data) {
  return request({
    url: `/video/video/${id}`,
    method: 'put',
    data: data,
  })
}

// 删除视频
export function deleteVideoInfo (id) {
  return request({
    url: `/video/video/${id}`,
    method: 'delete',
  })
}

// 上传文件到OSS存储
export function uploadVideo (data) {
  return request({
    url: `/oss/common/upload`,
    method: 'post',
    data: data
  })
}

// 上传图片
export function uploadImage (data) {
  return request({
    url: `/oss/common/upload`,
    method: 'post',
    data: data
  })
}

// 获取市场列表
export function getMarketList (data) {
  return request({
    url: `/purchaser/market/treeselect`,
    method: 'get',
    params: data,
  })
}
